package com.example.demo.controller;


import com.example.demo.client.ServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lzz
 * @package com.example.demo.controller
 * @create 2019-05-16 15:54
 * @description: ${DESCRIPTION}
 */
@RestController
public class TestController {

    @Autowired
    ServiceClient serviceClient;

    @Value("${server.port}") //配置文件中的端口号
    private String port;


    @RequestMapping("hello")
    public String hello(){
        return "hello "+port;
    }


    @RequestMapping("TOhello")
    public String TOhello(){

        return "hello service-client to service-client2"+serviceClient.hello();
    }

}
